Skip to content

Fix #5636: properly type param accessors in constructors #6746

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 26, 2019

Conversation

smarter
Copy link
Member

@smarter smarter commented Jun 25, 2019

Replace the condition as suggested in the comment, the referenced test
failures do not seem to happen anymore.

Replace the condition as suggested in the comment, the referenced test
failures do not seem to happen anymore.
@smarter smarter requested a review from odersky June 25, 2019 21:50
@@ -300,13 +300,9 @@ class Typer extends Namer
if (isSelfDenot(defDenot)) curOwner.enclosingClass.thisType
else {
val effectiveOwner =
if (curOwner.isTerm && defDenot.symbol.isType)
if (curOwner.isTerm && defDenot.symbol.maybeOwner.isType)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following alternative check passes all tests too:

Suggested change
if (curOwner.isTerm && defDenot.symbol.maybeOwner.isType)
if (curOwner.isConstructor)

This looks more obviously correct to me, wdyt @odersky ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think curOwner could also be localDummy. maybeOwner.isType looks correct.

@@ -300,13 +300,9 @@ class Typer extends Namer
if (isSelfDenot(defDenot)) curOwner.enclosingClass.thisType
else {
val effectiveOwner =
if (curOwner.isTerm && defDenot.symbol.isType)
if (curOwner.isTerm && defDenot.symbol.maybeOwner.isType)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, I think curOwner could also be localDummy. maybeOwner.isType looks correct.

@odersky odersky merged commit d871d1f into scala:master Jun 26, 2019
@Blaisorblade Blaisorblade deleted the fix-i5636 branch June 26, 2019 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants